package com.bjpowernode;

import com.bjpowernode.intercepter.MyIntercepter;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class configuration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        MyIntercepter myIntercepter = new MyIntercepter();
        InterceptorRegistration interceptorRegistration = registry.addInterceptor(myIntercepter);
        interceptorRegistration.addPathPatterns("/updateUser").excludePathPatterns("/usercount");

    }
}
